package com.kly.enums;

/**
 * 会员权益发放状态
 */
public enum BenefitsStatus {

    INIT(0, "未发放"),

    ISSUED(1, "已发放"),

    EXPIRY(2, "已到期"),

    INVALID(3, "已失效"),

    ;
    private int status;
    private String description;

    BenefitsStatus(int status, String description) {
        this.status = status;
        this.description = description;
    }

    public static BenefitsStatus fromType(int status) {

        for (BenefitsStatus orderStatus : values()) {
            if (orderStatus.getStatus() == status) {
                return orderStatus;
            }
        }
        return null;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
